package com.learn.design.strategy.example;

/**
 * @author Administrator
 */
public class CommonPairResponse<T, K> {

    private T message;

    private K result;

    public static <T, K> CommonPairResponse<T, K> success(T message, K result) {
        return new CommonPairResponse<T, K>().setMessage(message).setResult(result);
    }

    public static <T, K> CommonPairResponse<T, K> failure(T message) {
        return new CommonPairResponse<T, K>().setMessage(message).setResult(null);
    }

    public T getMessage() {
        return message;
    }

    public CommonPairResponse<T, K> setMessage(T message) {
        this.message = message;
        return this;
    }

    public K getResult() {
        return result;
    }

    public CommonPairResponse<T, K> setResult(K result) {
        this.result = result;
        return this;
    }
}
